(function($) { function do_all_client_side_twitter_oembed() { $.getScript('//platform.twitter.com/widgets.js', function() { $( '.pending-tweet' ).each( do_client_side_twitter_oembed ); } ); } // handle failed tweets or tweets that haven't been fetched yet function do_client_side_twitter_oembed() { var $this = $(this), text = $this.text(), url = 'http://api.twitter.com/1/statuses/oembed.json?omit_script=true&callback=?&'; // If we find an exact match, we want to fetch its content from the oembed endpoint and display it if ( text.match( /^http(s|):\/\/twitter\.com(\/\#\!\/|\/)([a-zA-Z0-9_]{1,20})\/status(es)*\/(\d+)$/ ) ) { url += 'url=' + encodeURIComponent( text ); } else if ( text.match( /^(\d+)$/ ) ) { url += 'id=' + text; } else { return; } // Need to make a JSONP call to avoid CORS issues $.getJSON( url, function( data ) { if ( data.html ) { $this.html( data.html ); $this.show(); twttr.widgets.load(); } } ); } $( document ).ready( do_all_client_side_twitter_oembed ); $( document.body ).on('post-load', do_all_client_side_twitter_oembed ); })(jQuery); ; jQuery( document.body ).on( 'post-load', function() { if ( typeof twttr == 'object' && twttr.widgets && twttr.widgets.load ) twttr.widgets.load(); });; function plusone_vote(){omniTrackEv("google+")}var lf_comment_count;jQuery(document).ready(function(a){a(".entry-tools .share > a").click(function(b){b.preventDefault();var c=a(this).closest("li");c.hasClass("selected")||omniTrackEv("share"),c.toggleClass("selected")}),a("[data-omniture-event]").click(function(){void 0!=typeof omniTrackEv&&omniTrackEv(a(this).attr("data-omniture-event"))});var b="ontouchstart"in document.documentElement;b||(a(".read-later > a").on("mouseenter",function(){a(".read-later > ul").show()}),a(".read-later").on("mouseleave",function(){a(".read-later > ul").hide()})),a(".more-photos").length&&a(".more-photos .categories li a").click(function(b){b.preventDefault();var c=a(this).attr("data-site");a(".more-photos .categories li").removeClass("current"),a(".more-photos .gallery-thumbs").addClass("loading"),a(this).parent().addClass("current"),a.ajax({url:ajaxurl,data:{action:"time_get_remote_galleries",site:c,_ajax_nonce:ajax_nonce},dataType:"json",success:function(b){b.html&&(a(".more-photos .gallery-thumbs").html(b.html),a(".more-photos .gallery-thumbs").removeClass("loading"))}})}),a(".single").length&&Modernizr.load({load:["http://widgets.outbrain.com/outbrain.js","http://cdn.taboolasyndication.com/libtrc/timeinc-time/loader.js"]}),a(".entry-sharing, .widget_time_follow, .widget_time_connect").length&&Modernizr.load({load:["https://platform.twitter.com/widgets.js","http://connect.facebook.net/en_US/all.js#xfbml=1","https://apis.google.com/js/plusone.js","http://platform.linkedin.com/in.js","http://assets.pinterest.com/js/pinit.js"],complete:function(){FB.Event.subscribe("edge.create",function(b){omniTrackEv("fb-like"),a(".double-like").length&&"desktop"===ad_mode&&(a(".double-like").show(),omniTrackEv("double-like-display")),"http://www.facebook.com/time#dbl"==b&&omniTrackEv("double-like-click")}),twttr.events.bind("tweet",function(){omniTrackEv("tweet")})}}),a(".share-fb-button").length&&a(".share-fb-button .fb-share").click(function(){window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(window.location.href),"Share","toolbar=0,status=0,width=600,height=400")}),lf_comment_count=function(){LF.CommentCount({replacer:function(a,b){a.innerHTML=0===b?"Add a Comment":b+" Comment"+(1===b?"":"s")}})};var c=document.createElement("script");c.type="text/javascript",c.async=!0,c.onload=lf_comment_count,c.setAttribute("data-lf-domain","time.fyre.co"),c.src="http://zor.livefyre.com/wjs/v1.0/javascripts/CommentCount.js";var d=document.getElementsByTagName("script")[0];d.parentNode.insertBefore(c,d)}),navigator.mozApps&&window.locationbar.visible===!1&&$("a[href^='http']:not([href*='time.com'])").attr("target","_blank");;